From: Florian Müllner Date: Fri, 17 Jan 2014 15:54:13 +0000 (-0500) Subject: window-tracker: Always enable transient_for redirection X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~2888 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=cca14053a48783d610595efb79b91283f6359806;p=gnome-shell.git window-tracker: Always enable transient_for redirection It is possible to associate an application's window with a different application using the transient_for hint. However we currently only consider the hint in get_window_app() and not when making the original association, which opens the door to some confusing inconsistencies; for instance, get_window_app() will not necessarily return the same value for all windows retrieved via shell_app_get_windows(). Fix this by looking at the transient_for hint when making the original association, not just in get_window_app(). https://bugzilla.gnome.org/show_bug.cgi?id=722434 --- diff --git a/src/shell-window-tracker.c b/src/shell-window-tracker.c index 9cb48986e..1e3d20a93 100644 --- a/src/shell-window-tracker.c +++ b/src/shell-window-tracker.c @@ -384,8 +384,13 @@ get_app_for_window (ShellWindowTracker *tracker, MetaWindow *window) { ShellApp *result = NULL; + MetaWindow *transient_for; const char *startup_id; + transient_for = meta_window_get_transient_for (window); + if (transient_for != NULL) + return get_app_for_window (tracker, transient_for); + /* First, we check whether we already know about this window, * if so, just return that. */ @@ -681,13 +686,8 @@ ShellApp * shell_window_tracker_get_window_app (ShellWindowTracker *tracker, MetaWindow *metawin) { - MetaWindow *transient_for; ShellApp *app; - transient_for = meta_window_get_transient_for (metawin); - if (transient_for != NULL) - metawin = transient_for; - app = g_hash_table_lookup (tracker->window_to_app, metawin); if (app) g_object_ref (app);